package com.ideaaedi.zoo.example.springboot.auth.satoken.entity;

import com.ideaaedi.zoo.commonbase.entity.codemsg.CodeMsgProvider;
import lombok.Getter;

/**
 * 基础 code message
 * <p>
 * 错误码:
 *     <ul>
 *         <li>报错  1xxxxx</li>
 *     </ul>
 * </p>
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@Getter
public enum DemoBaseCodeMsgEnum implements CodeMsgProvider {
    
    /** item */
    SUCCESS(SUC_CODE, "成功"),
    FAILURE("100000", "服务异常，请稍后再试"),
    ;
    
    private final String code;
    
    private final String message;
    
    DemoBaseCodeMsgEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }
    
    @Override
    public String code() {
        return this.code;
    }
    
    @Override
    public String message() {
        return this.message;
    }
    
    @Override
    public String toString() {
        return "{\"code\":\"" + code + "\", \"message\":\"" + message + "\"}";
    }
}
